class Solution {
public:
    int buyChoco(vector<int>& prices, int money) {
        std::sort(prices.begin(), prices.end());
        int m = 0;
        int n = 1;
        if ((prices[m] + prices[n]) <= money)
        {
            return money - (prices[m] + prices[n]);
        }
        else
        {
            return money;
        }
    }
};